﻿<?php
require_once 'classes/photos.php';
require_once 'classes/mySession.php';

if(!$pgSession->isUserLoggedIn()){
	$retorno = array("status"=>FALSE,"message"=>"No user logged in.");
}else{
	$ownerN = $pgSession->getUserId();
	$idN = $_GET["photoid"];
	if(isset($idN) && !is_null($idN)){
		$search = $photoUtils->findPhotoById($idN,$ownerN);
		
		if($search["status"]){
			$p = (array) $search["photo"];
			echo json_encode($p);
		}else{
			echo json_encode($search["message"]);
		}
	}
}
//$retorno = array("id" => 9, "url" => "default.jpg", "descricao" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent bibendum risus luctus augue vehicula elementum. Nunc pulvinar commodo laoreet. Sed eu dolor semper, venenatis lacus sed, pharetra mauris. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse potenti. Vivamus erat urna, iaculis eu gravida vel, convallis eu sem. Pellentesque tincidunt velit magna, non fermentum ipsum pharetra id. Phasellus eu feugiat purus. Quisque ultricies dolor leo, in convallis magna viverra id.", "album" => "Vilarejos da Argentina", "latitude" => "-7.125383", "longitude" => "-34.8209549");

